package demo.properties;

import com.alibaba.fastjson.JSON;
import org.springframework.util.ResourceUtils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * @author : GuoFei
 * @date : 2019/3/7 16:43
 */
public class PropertiesTest {

    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.load(new FileInputStream(ResourceUtils.getFile("classpath:properties/local/jdbc.properties")));
        new Thread(() -> System.out.println("nihO"));
        System.out.println(properties);
        System.out.println(JSON.toJSONString(properties));
        System.out.println(properties.getProperty("test","ttt"));
        System.out.println(properties.propertyNames());
        System.out.println(JSON.toJSONString(properties.propertyNames()));
        System.out.println(JSON.toJSONString(properties.stringPropertyNames()));
        System.out.println(JSON.toJSONString(properties.keySet()));
    }

}
